﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BestCode.Creds.Data;
using BestCode.Creds.Entities;

namespace BestCode.Creds.Business
{
    public class EntityChildBusiness : BusinessBase<EntityChild>
    {
        private IEntityChildDao dao = DataFactory.Current.GetEntityChildDao();

        public EntityChildBusiness()
        {
            setDao(dao);    
        }

        public override ObservableCollection<EntityChild> SearchByFilter(string parameter)
        {
            return new ObservableCollection<EntityChild>(dao.GetByFilter(parameter));
        }

        public List<EntityChild> GetByEntityId(int entityId)
        {
            return dao.GetByEntityId(entityId).ToList();
        }
    }
}
